<me:UIAM06 x:Class="WPFExcelReport.TAMEINST"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"  
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                     xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR"  
                    xmlns:AM="clr-namespace:WPFExcelReport;assembly=TAMSTAMM" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIAM06.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter  x:Key="nbv"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIAM06.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"  >
            <WrapPanel Visibility="Collapsed">
                <Button Click="ResetSeq" Content="{Binding Source={Localization:Translate Word=重置序列号}}"
                    Visibility="{Binding IsITX,Converter={StaticResource bv}}"/>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top"  Visibility="Collapsed"
                      >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <DR:TDRAUFTR  Grid.Column="0" Name="cDR" DocType="{Binding PRTYPE,ElementName=TV}" PrintType="OpenExcel" />
                    <Button  Grid.Column="1"   Click="btnPrint_Click" Height="20" Margin="5,0,0,0" Width="Auto" Content="{Binding Source={Localization:Translate Word=打印确认函}}" />
                </Grid>
                <TextBlock   Text="{Binding Source={Localization:Translate Word=设备}}"/>
                <TextBlock    Text="{Binding KRS,ElementName=TV}" Width="30" />
                <TextBlock   Text="{Binding LFD,ElementName=TV}" Width="60" />
                <TextBlock    Text="{Binding POS,ElementName=TV}"  Width="40" />
                <TextBlock    Text="{Binding ART,ElementName=TV}"  Width="40" />
                <Button Grid.Column="0"  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                    </Button.Background>
                </Button>
            </WrapPanel>
            <WrapPanel>
            <WrapPanel   Margin="0,20,0,0">
                <Button  Click="EditCommand" Width="24" Height="20" 
                         Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                    </Button.Background>
                </Button>
                <Button   Click="SaveCommand" Height="20"  Width="24" 
                          Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                    </Button.Background>
                </Button>
                <Button Click="DeleteCommand" Height="20"  Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                    </Button.Background>
                </Button>
                <Button Grid.Column="0"  Click="QueryCommand" Height="20"   Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                    </Button.Background>
                </Button>
                <Button Click="CopyMTPCommand" Height="20"   Width="24" 
                        IsEnabled="{Binding IsCanCopy,ElementName=TV}">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                    </Button.Background>
                </Button>
                <TextBlock Text="{Binding Source={Localization:Translate Word=同类型}}"/> 
            </WrapPanel>
            <WrapPanel Margin="0,20,0,0">
                <Button Grid.Column="0"  Click="NewCommand" Height="20"   Width="24"
                            IsEnabled="{Binding IsCanNew,ElementName=TV}"
                            >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                    </Button.Background>
                </Button>
                <WrapPanel IsEnabled="{Binding IsNew,ElementName=TV}">
                    <TextBlock Text="{Binding Source={Localization:Translate Word=个数:}}"/>
                    <ex:NumericBox Grid.Column="1" FontSize="16"  
                            Text="{Binding QTY,ElementName=TV}" Width="40" />
                    <TextBlock Text="{Binding Source={Localization:Translate Word=ID:}}"/>
                    <ex:TXT72 Grid.Column="1" FontSize="16" MaxLength="3"  
                          PRE="000"  CharacterCasing="Upper" Text="{Binding EINSTNR,ElementName=TV}" Width="40" />
                    <TextBlock Text="{Binding Source={Localization:Translate Word=编码:}}"/>
                    <SD:K0706 
                            IsEdit="True"
                            KEY="{Binding MESCHL,ElementName=TV}"
                          />
                    <Button Grid.Column="0"  Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                        </Button.Background>
                    </Button>
                </WrapPanel>
            </WrapPanel>
            </WrapPanel>
            <WrapPanel Margin="0,20,0,0">
            <WrapPanel    Visibility="Collapsed">
                <TextBlock  Margin="20,0,0,0" Text="{Binding Source={Localization:Translate Word=模块:}}"/>
                <TextBlock  Margin="20,0,0,0"  Text="{Binding AMEMODNR}" Width="24" />
                <TextBlock  Margin="20,0,0,0" Text="{Binding Source={Localization:Translate Word=序号:}}"/>
                <TextBlock  Margin="20,0,0,0" Text="{Binding AMEEINSTNR}" Width="24" />
            </WrapPanel>
            <WrapPanel >
                    <TextBlock  Margin="5,0,0,0" Text="{Binding Source={Localization:Translate Word=说明:}}"/>
                <ex:TXT72 Margin="5,0,0,0"  MaxLength="40"  
                      IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                      Text="{Binding AMEBEZ,Converter={StaticResource gb2312}}" Width="80" />
                <TextBlock Margin="5,0,0,0"  Text="{Binding Source={Localization:Translate Word=简述:}}" />
                <ex:TXT72 MaxLength="10"   Margin="5,0,0,0"  
                      IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"  
                      Text="{Binding AMEKBEZ,Converter={StaticResource gb2312}}" Width="80" /> 
            </WrapPanel>
            <WrapPanel>
                    <TextBlock  Margin="5,0,0,0" Text="{Binding Source={Localization:Translate Word=编码:}}" Foreground="Red"/>
                    <ex:TXT72 MaxLength="10"   Margin="5,0,0,0"
                      IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                      Text="{Binding AMEMESCHL,Converter={StaticResource gb2312}}" Width="40" />
                <SD:K9322 KEY="{Binding AMEMESCHL,ElementName=TV}"
                          IsEdit="{Binding IsEdit,ElementName=TV}"
                          />
                <TextBlock  Margin="5,0,0,0" Text="{Binding Source={Localization:Translate Word=类型:}}" Foreground="Red" Visibility="Collapsed"/>
                <ex:TXT72 MaxLength="10"   Margin="5,0,0,0" Visibility="Collapsed"
                      IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" 
                      Text="{Binding AMEPROGKZ,Converter={StaticResource gb2312}}" Width="40" />
                <SD:K9343 KEY="{Binding AMEPROGKZ,ElementName=TV}"
                          IsEdit="{Binding IsEdit,ElementName=TV}" Visibility="Collapsed"/>
            </WrapPanel>
          
            </WrapPanel>
            <WrapPanel Margin="0,20,0,0">
                <TextBlock  Text="{Binding Source={Localization:Translate Word=BDE:}}"/>
                <me:TSZL06 
                    x:Name="cZL06"
                        Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                        IsEdit="{Binding IsEdit,ElementName=TV}" 
                        BDEKEN="{Binding BDEKEN,ElementName=TV}" 
                       />
                <TextBlock  Text="{Binding Source={Localization:Translate Word=绑定:}}"/>
                <me:TSZL05 
                    x:Name="cZL05"
                        Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                        IsEdit="{Binding IsEdit,ElementName=TV}" 
                        BDEKEN="{Binding BDEMOD,ElementName=TV}" 
                       />
                <ex:TXT72 MaxLength="8"  
                      IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                      Text="{Binding AMEBDEKEN,Converter={StaticResource gb2312}}" Width="120" />
                <TextBlock  Text="{Binding Source={Localization:Translate Word=刷新(秒):}}"/>
                <ex:TXT72 MaxLength="16"  
                      IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                     Text="{Binding AMEINTERVAL,Converter={StaticResource d1000}}" Width="40" />

            </WrapPanel>
            <Expander Header="{Binding Source={Localization:Translate Word=其他}}" Margin="0,20,0,0">
                <WrapPanel>
                         <SD:K0706 
                            IsEdit="{Binding IsEdit,ElementName=TV}"
                            KEY="{Binding MESCHL,ElementName=TV}"
                          />
                        <ex:TXT72 MaxLength="2"  
                      IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                      Text="{Binding AMEMESCHL}" Width="80" />
                        <TextBlock  Text="{Binding Source={Localization:Translate Word=最小值:}}"/>
                        <ex:TXT72 MaxLength="16"  
                      IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                      Text="{Binding AMEWERTVON}" Width="80" />
                        <TextBlock  Text="{Binding Source={Localization:Translate Word=最大值:}}"/>
                        <ex:TXT72 MaxLength="16"  
                      IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                      Text="{Binding AMEWERTBIS}" Width="40" />
                        <TextBlock  Text="{Binding Source={Localization:Translate Word=精确值1:}}"/>
                        <ex:TXT72 MaxLength="16"  
                      IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                      Text="{Binding AMEWERTEX1}" Width="120" />
                        <TextBlock  Text="{Binding Source={Localization:Translate Word=精确值2:}}"/>
                        <ex:TXT72 MaxLength="16"  
                      IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                      Text="{Binding AMEWERTEX2}" Width="120" />
                        <TextBlock  Text="{Binding Source={Localization:Translate Word=精确值3:}}"/>
                        <ex:TXT72 MaxLength="16"  
                      IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                      Text="{Binding AMEWERTEX3}" Width="120" />
                        <TextBlock  Text="{Binding Source={Localization:Translate Word=精确值4:}}"/>
                        <ex:TXT72 MaxLength="16"  
                      IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                      Text="{Binding AMEWERTEX4}" Width="120" />
                    </WrapPanel>
                </Expander> 
                <WrapPanel>
                    <SD:K8880  IsEdit="{Binding IsEdit,ElementName=TV}"
                       Visibility="Collapsed"
                       KEY="{Binding KEY,ElementName=TV}"
                       ORDERNUM="{Binding KEY,ElementName=TV}"
                />
                </WrapPanel> 
        </StackPanel>
        <DataGrid  Grid.Row="1"  Grid.Column="0" 
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"  
                    >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding AMEMODNR}" Header="{Binding Source={Localization:Translate Word=模块}}" Width="40"/>
                <DataGridTextColumn  Binding="{Binding AMEEINSTNR,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=项目}}" Width="40"/>
                <DataGridTextColumn  Binding="{Binding AMEMESCHL}" Header="{Binding Source={Localization:Translate Word=CD}}" Width="Auto"/>
                <DataGridTextColumn  Binding="{Binding AMEBDEKEN}" Header="{Binding Source={Localization:Translate Word=BDE}}" Width="Auto"/>
                <DataGridTextColumn  Binding="{Binding AMEBEZ,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=说明}}" Width="80"/>
                <DataGridTextColumn  Binding="{Binding AMEWERTNR}" Header="{Binding Source={Localization:Translate Word=编号}}" Width="40"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</me:UIAM06>
